using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace H9
{
    public partial class Form1 : Form
    {
        double a1, b2;
        double a, b;
        string fh,sh = "";
        public Form1()
        {
            InitializeComponent();
        }

        private void button_tty(object sender,EventArgs e)
        {
            a = double.Parse(textBox1.Text);
            Button btn = (Button)sender;
            fh = btn.Text.ToString();
            sh += fh;
            textBox1.Text = sh;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            switch (fh)
            {
                case "+": b = a + b2; break;
                case "-": b = a - b2; break;
                case "x": b = a * b2; break;
                case "/": b = a / b2; break;
            }
            sh += "=";
            sh+=b.ToString();
            textBox1.Text = sh;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.textBox1.Text ="";
            sh = "";

        }

        private void button_ty(object sender, EventArgs e)
        {
            Button btn = (Button)sender;    
            
            b2 = double.Parse(btn.Text);
            sh+=btn.Text.ToString();
            textBox1.Text=sh;
        }
    }
}